package xyz.tanxiao.links.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * MyBatisPlus配置
 *
 * @author 万成波
 * @email 2300064869@qq.com
 * @createTime 2023-06-10 00:52:56 星期六
 */
@EnableTransactionManagement
@MapperScan("xyz.tanxiao.**.mapper")
@Configuration
public class MyBatisPlusConfig {

	@Bean
	public MybatisPlusInterceptor mybatisPlusInterceptor() {
		MybatisPlusInterceptor plusInterceptor = new MybatisPlusInterceptor();
		plusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
		return plusInterceptor;
	}

}